package com.evan.uyclub.Other;

import android.app.Dialog;
import android.content.Context;

import androidx.annotation.NonNull;

import com.daimajia.androidanimations.library.attention.WaveAnimator;
import com.evan.uyclub.R;
import com.github.ybq.android.spinkit.SpinKitView;
import com.github.ybq.android.spinkit.sprite.Sprite;
import com.github.ybq.android.spinkit.style.ChasingDots;
import com.github.ybq.android.spinkit.style.CubeGrid;
import com.github.ybq.android.spinkit.style.FadingCircle;
import com.github.ybq.android.spinkit.style.FoldingCube;
import com.github.ybq.android.spinkit.style.WanderingCubes;
import com.github.ybq.android.spinkit.style.Wave;

public class LoadDialog extends Dialog {
    /**
     * 加载框工具
     *
     * @param context
     */
    public LoadDialog(@NonNull Context context) {
        super(context, R.style.dialogs);
        setContentView(R.layout.dialog_loading);
        SpinKitView spink = (SpinKitView) findViewById(R.id.spink);
        Sprite spinks = new Wave();
        spink.setIndeterminateDrawable(spinks);
    }

    public void show(boolean type) {
        setCancelable(type); // 返回键是否允许关闭
        setCanceledOnTouchOutside(type); // 点击界面是否允许关闭
        super.show();
    }
}
